In certain situations, a processor may dynamically optimize portions of code to increase performance during execution. For example, a processor may optimize code by reducing the instruction path length, reducing repetitive code, modifying branching instructions, and so forth. Current techniques to dynamically optimize code are often inefficient and limited in their ability to protect the integrity of the original code in a multi-core environment.